<template>
  <div>
    <searchList />
    <el-table :data="list">
      <el-table-column label="序号" type="index" :index="indexs" />
      <el-table-column label="工单编号" prop="taskCode" />
      <el-table-column label="设备编号" prop="innerCode" />
      <el-table-column label="工单类型" prop="taskType.typeName" />
      <el-table-column label="工单方式" prop="createType" />
      <el-table-column label="工单状态" prop="taskStatusTypeEntity.statusName" />
      <el-table-column label="运营人员" prop="userName" />
      <el-table-column label="创建日期" prop="createTime" />
      <el-table-column label="操作" />
    </el-table>
    <paging :total="totalCount" :current-page="pageIndex" :page-size="pageSize" @nextPage="nextPages" />
  </div>

</template>
<script>
import searchList from '@/components/searchList'
import paging from '@/components/paging/index.vue'
import { getSearch } from '@/api/WorkOrder'
export default {
  components: { searchList, paging },
  data() {
    return {
      list: [],
      createType: ['自动', '手动'],
      totalPage: 0,
      pageIndex: 1,
      pageSize: 10,
      totalCount: 0
    }
  },

  mounted() {
    this.getSearch()
  },
  methods: {
    async getSearch() {
      const res = await getSearch({
        pageIndex: this.pageIndex,
        pageSize: this.pageSize,
        isRepair: false
      })
      console.log(res)
      this.list = res.currentPageRecords
      this.totalPage = res.totalPage
      this.pageIndex = res.pageIndex
      this.pageSize = res.pageSize
      this.totalCount = res.totalCount
    },
    nextPages(val) {
      this.pageIndex = val
      this.getSearch()
    },
    indexs(val) {
      return val + 1 + (this.pageIndex - 1) * 10
    }
  }
}
</script>

<style>

</style>
